package com.api.syh56.shengyunhui.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.DefaultValue;
import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.FieldDefaults;

import java.time.LocalDateTime;

@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
@TableName("car")
public class Car {
    @Column(name = "id",isKey = true,isAutoIncrement = true)
    Long id;

    @Column(name = "car_number",comment = "车牌号码，司机必填")
    private String carNumber;

    @Column(name ="car_type", comment = "车型")
    private String carType;

    @Column(name = "car_length", comment = "车长")
    private String carLength;

    @Column(name = "car_load", comment = "车载重")
    private String carLoad;

    @Column(name = "valid_time", comment = "道路运输证有效期")
    private String validTime;

    @Column(name = "uid",comment = "用户表id（用于指向用户id）")
    private Long uid;

    @TableField(fill = FieldFill.INSERT)
    @Column(name = "creator_user_id")
    private Long creatorUserId;

    @Column(name = "creation_time")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime creationTime;


    @Column(name = "last_modifier_user_id") // 最后修改者用户ID
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long lastModifierUserId;

    @Column(name = "last_modification_time") // 最后修改时间
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime lastModificationTime;

    @Column(name = "is_default",comment = "是否默认")
    private Boolean isDefault;

    @TableLogic
    @Column(name = "is_deleted")
    @DefaultValue("false")
    private Boolean isDeleted;
}
